package cool.lichuan.project.system.dto;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

import java.io.*;

/**
 * @program: yuemiao
 * @ClassName CustInfo
 * @description:
 * @author: Liyongxing
 * @create: 2021-12-24 18:47
 **/
@Data
@Configuration
public class CustInfo implements Serializable, Cloneable {
    private String birthday;
    /**
     * 手机号
     */
    private String tel;
    /**
     * 性别 1男 2女
     */
    private String sex;
    /**
     * 中文名称
     */
    private String cname;
    /**
     * 身份证号
     */
    private String idcard;
    private String mxid;
    /**
     * 预约时间（yyyy-MM-dd）
     */
    private String date;
    /**
     * 产品ID
     */
    String pid;
    /**
     * 医院ID
     */
    private String id;

    private String Ftime = "1";
    private String guid = "";
    private String cookie;

    public Object deepClone() throws Exception {
        // 序列化
        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        ObjectOutputStream oos = new ObjectOutputStream(bos);

        oos.writeObject(this);

        // 反序列化
        ByteArrayInputStream bis = new ByteArrayInputStream(bos.toByteArray());
        ObjectInputStream ois = new ObjectInputStream(bis);

        return ois.readObject();
    }
}
